﻿using System;
using System.Reflection;

namespace MugenInjection.Interface
{
    /// <summary>
    /// Represents the interface that creates and injects values into the specified object.
    /// </summary>
    public interface IActivator : IDisposableObject
    {
        /// <summary>
        /// Creates new instance of the specified service, and injects values into properties, fields, methods.
        /// </summary>
        /// <param name="constructorInfo">The specified <see cref="ConstructorInfo"/>.</param>
        /// <param name="bindingContext">The specified <see cref="IBindingContext"/>.</param>
        /// <returns>An instance of the service.</returns>
        object Activate(ConstructorInfo constructorInfo, IBindingContext bindingContext);

        /// <summary>
        /// Injects values into properties, fields, methods in the specified object.
        /// </summary>
        /// <param name="target">The specified target for inject.</param>
        /// <param name="context">The specified <see cref="IBindingContext"/>.</param>
        void Activate<T>(ref T target, IBindingContext context);
    }
}